document.writeln("<div class=\"mnav_top\">");
document.writeln("		<div id=\"nologin\" class=\"loginbox\"><a onclick=\"urljump();\" style=\"cursor:pointer\">登录</a><span>-</span><a class=\"fl\" target=\"_blank\" href=\"/products/regist?m=toregphone\">注册</a></div>");
document.writeln("	<div id=\"jloginbox\" class=\"loginbox\"></div>");
document.writeln("	</div>");
document.writeln("<style type=\"text/css\">");
document.writeln(".mnav_top .loginbox{color:#666666;display:inline;float:left;height:30px;line-height:30px;}");
document.writeln(".mnav_top .loginbox strong{color:#333333;float:left;font-size:13px;font-weight:normal;}");
document.writeln(".mnav_top .loginbox span{font-size:12px;margin:0 6px;}");
document.writeln(".mnav_top .loginbox a{color:#666666;margin:0;text-decoration:none;text-align:center;}");
document.writeln(".mnav_top .loginbox a:hover{color:#FF6600;text-decoration:none;}");
document.writeln(".mnav_top .logint{padding-right: 5px;padding-left: 19px; margin-left: 10px;}");

document.writeln(' </style> ');
if (document.all){
window.attachEvent('onload', onloadloginstatus)//IE中
}
else{
window.addEventListener('load',onloadloginstatus,false);//firefox
}
function onloadloginstatus () {
	if (getlogincookie != ''&&getlogincookie!="null") {
		if(getlogincookie.length>5){
			getlogincookie=getlogincookie.substr(0,5)+"*";
		}
		document.getElementById("nologin").style.display="none";;
		var jloginbox = document.getElementById("jloginbox");
		var currenturl = window.location.href;
		jloginbox.innerHTML=
		'<strong>'+getlogincookie+'</strong><span>|</span><a href="/products/loginout?currenturl='+currenturl+'" class="fliu">注销</a>	';
	}
}	
function getCookie(c_name)
{
	if(document.cookie.length>0){
	   c_start=document.cookie.indexOf(c_name + "=")
	   if(c_start!=-1){ 
		 c_start=c_start + c_name.length+1 
		 c_end=document.cookie.indexOf(";",c_start)
		 if(c_end==-1) c_end=document.cookie.length
		 return hidename(unescape(document.cookie.substring(c_start,c_end)))
	   }
	}
	return ""
}

function hidename(name){
	var RegCellPhone = /^([0-9]{11})?$/;
	var hideString='******';
	if(name==""){
		return "";
	}
	if(name.search(RegCellPhone)>-1){
		var phoneuser = name.substring(0,3)+"****"+name.substring(7,11);
		return phoneuser;
	}
	if(name.indexOf('@')>-1){
		var emailarray = name.split('@');
		var emailname = emailarray[0];
		if(emailname.length<6){
			emailname = emailname.substring(0,1)+hideString.substring(0,emailname.length-2)+emailname.substring(emailname.length-1,emailname.length);
		}else{
			emailname = emailname.substring(0,1)+"****"+emailname.substring(emailname.length-1,emailname.length);
		}
		var emailuser = emailname +"@"+emailarray[1];
		return emailuser;
	}else{
		if(name.length<6){
			name = name.substring(0,1)+hideString.substring(0,name.length-2)+name.substring(name.length-1,name.length);
		}else{
			name = name.substring(0,1)+"****"+name.substring(name.length-2,name.length);
		}
		return name;
	}
}
function urljump() {
	window.location.href="/products/login?backurl="+window.location.href;
	return;
}